package com.fastwire.carriere.rad.entity;

import java.util.Date;

/*
 * Created on 20120225
 * @author: Lei Jun
 */
public class RadLog
{
    private long oid;

    private int version;

    private long index;

    private String message;

    private String sysUpTime;

    private String ipAddr; // FK
    
    private Date updateTime;  // when get this log
    

    public RadLog(String ip)
    {
        ipAddr = ip;
    }
    
    public RadLog()
    {};
    
    /**
     * @return the version
     */
    public int getVersion()
    {
        return version;
    }

    /**
     * @param version the version to set
     */
    public void setVersion(int version)
    {
        this.version = version;
    }


    public long getOid()
    {
        return oid;
    }

    public void setOid(long oid)
    {
        this.oid = oid;
    }

    /**
     * @return the index
     */
    public long getIndex()
    {
        return index;
    }

    /**
     * @param index the index to set
     */
    public void setIndex(long index)
    {
        this.index = index;
    }

    /**
     * @return the message
     */
    public String getMessage()
    {
        return message;
    }

    /**
     * @param message the message to set
     */
    public void setMessage(String message)
    {
        // 1970-01-01 00:00:05 LINK DOWN ON Eth3
        parseMsg(message);
    }

    // 1970-01-01 00:00:05 LINK DOWN ON Eth3
    private void parseMsg(String msg)
    {
        /*
        int tmp = msg.indexOf(" ");
        tmp = msg.indexOf(" ", tmp+1);
        String date = msg.substring(0, tmp);
        
        datetime = DateUtil.parseDatetime(date);

        this.message = msg.substring(tmp + 1);
        */
        this.message = msg;
    }
    

    

    /**
     * @return the sysUpTime
     */
    public String getSysUpTime()
    {
        return sysUpTime;
    }

    /**
     * @param sysUpTime the sysUpTime to set
     */
    public void setSysUpTime(String sysUpTime)
    {
        this.sysUpTime = sysUpTime;
    }

    /**
     * @return the ipAddr
     */
    public String getIpAddr()
    {
        return ipAddr;
    }

    /**
     * @param ipAddr the ipAddr to set
     */
    public void setIpAddr(String ipAddr)
    {
        this.ipAddr = ipAddr;
    }

    /**
     * @return the updateTime
     */
    public Date getUpdateTime()
    {
        return updateTime;
    }

    /**
     * @param updateTime the updateTime to set
     */
    public void setUpdateTime(Date updateTime)
    {
        this.updateTime = updateTime;
    }

    
}
